package com.datechange.demo.controller;

import com.datechange.demo.entity.CmsPublicContent;
import com.datechange.demo.service.CmsPublicContentService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 内容(CmsPublicContent)表控制层
 *
 * @author makejava
 * @since 2020-12-09 10:46:02
 */
@RestController
@RequestMapping("cmsPublicContent")
@Api(tags = "cms服务")
public class CmsPublicContentController {
    /**
     * 服务对象
     */
    @Resource
    private CmsPublicContentService cmsPublicContentService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public CmsPublicContent selectOne(String id) {
        return this.cmsPublicContentService.queryById(id);
    }

    @GetMapping("/list")
    public List<CmsPublicContent> list(String pid) {
        return this.cmsPublicContentService.list(pid,"");
    }



}